#ifndef VALIDITYEXCEPTION_H
#define	VALIDITYEXCEPTION_H
#include <string>
#include <cstdarg>

enum ValidityError {
    // FormatValidator
    syvNoError = 0,
    syvTypeNotFound,
    syvNoTypeSpecified,
    syvSequenceExpected,
    syvMapExpected,
    syvDuplicateMember,
    syvIncompatibleEnums,
    syvDuplicateValue,
    syvEmptyEnum,
    syvEmptyStruct,
    syvInvalidNodeType,
    syvTooManyKeywords,
    syvValueNotBoolean,
    syvInvalidValue,
    syvValueNotFoundInEnum,
    syvStringTooLong,
    syvArrayTooLong,
    syvFormatNotMatched,
    syvValueUnderMin,
    syvValueOverMax,
    syvMemberNotFound,
    syvInvalidArrayDeclaration,
    syvCyclicReferenceDetected,
    syvInvalidType,
    syvInvalidKeyword,
    syvUnknownError,
    // YamlValidator
    syvNullNotAllowed,
    syvKeyMissing,
    syvKeyUndefined,
    syvNoDefinition,
    // Both
    syvInternalError
};

/**
 * Transfer string to client application with description of what went wrong.
 */
class ValidityException: public std::exception {
private:
    std::string trace;
    ValidityError errorcode;
public:
    ValidityException(ValidityError ec, const char*s, ...);
    virtual ~ValidityException() throw ();
    virtual const char* what() const throw();
    virtual ValidityError error() const throw();
};


#endif	/* VALIDITYEXCEPTION_H */

